namespace Microsoft.ServiceModel.Samples.Discovery.Protocol
{
    using System;
    using System.ServiceModel.Channels;

    public class InputBinding
    {
        Binding binding;
        Uri listenUri;
        Uri toUri;

        public InputBinding(Binding binding, Uri listenUri)
            : this(binding, listenUri, new Uri(ProtocolStrings.DiscoveryAddress))
        {
        }

        public InputBinding(Binding binding, Uri listenUri, Uri toUri)
        {
            if (binding == null)
                throw new ArgumentNullException("binding");

            if (listenUri == null)
                throw new ArgumentNullException("listenUri");

            if (toUri == null)
                throw new ArgumentNullException("toUri");

            this.binding = binding;
            this.listenUri = listenUri;
            this.toUri = toUri;
        }

        public Binding Binding
        {
            get
            {
                return this.binding;
            }

            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");

                this.binding = value;
            }
        }

        public Uri ListenUri
        {
            get
            {
                return this.listenUri;
            }

            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");

                this.listenUri = value;
            }
        }

        public Uri ToUri
        {
            get
            {
                return this.toUri;
            }

            set
            {
                if (value == null)
                    throw new ArgumentNullException("value");

                this.toUri = value;
            }
        }
    }
}
